<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>aiengine: xaiegbl.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">aiengine
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaiegbl_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">xaiegbl.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the global initialization functions for the Tile. </p>
<p>This is applicable for both the AIE tiles and Shim tiles.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who     Date     Changes
</p>
<hr/>
<p>
1.0  Naresh  03/14/2018  Initial creation
1.1  Naresh  04/12/2018  Code changed to fix CR#999685
1.2  Naresh  05/23/2018  Updated code to fix CR#999693
1.3  Naresh  07/11/2018  Updated copyright info
1.4  Nishad  12/05/2018  Renamed ME attributes to AIE
1.5  Jubaer  05/24/2019  Add PL type on TileType attribute
1.6  Nishad  07/31/2019  Add support for RPU baremetal
1.7  Wendy   01/20/2020  Add tiles pointer to AIE instance
</pre> </div><table class="memberdecls">
<tr class="memitem:ae21f879b80da9aca8212dbb9d33696cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_x_aie_gbl___config.html">XAieGbl_Config</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaiegbl_8c.html#ae21f879b80da9aca8212dbb9d33696cc">XAieGbl_ConfigTable</a> []</td></tr>
<tr class="memdesc:ae21f879b80da9aca8212dbb9d33696cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">XAIE_BASE_ARRAY_ADDR_OFFSET macro defines the AI Engine's base address offset value.  <a href="#ae21f879b80da9aca8212dbb9d33696cc">More...</a><br/></td></tr>
<tr class="separator:ae21f879b80da9aca8212dbb9d33696cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6422e72b033ca8d8456af7432d1fd11"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaiegbl_8c.html#ad6422e72b033ca8d8456af7432d1fd11">XAieGbl_CfgInitialize</a> (<a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *InstancePtr, <a class="el" href="struct_x_aie_gbl___tile.html">XAieGbl_Tile</a> *TileInstPtr, <a class="el" href="struct_x_aie_gbl___config.html">XAieGbl_Config</a> *ConfigPtr)</td></tr>
<tr class="memdesc:ad6422e72b033ca8d8456af7432d1fd11"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the global initialization function for all the tiles of the AIE array and also for the Shim tiles.  <a href="#ad6422e72b033ca8d8456af7432d1fd11">More...</a><br/></td></tr>
<tr class="separator:ad6422e72b033ca8d8456af7432d1fd11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2dbe8c9e25ce298bffbc257a95ec530"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaiegbl_8c.html#ac2dbe8c9e25ce298bffbc257a95ec530">XAieGbl_HwInit</a> (<a class="el" href="struct_x_aie_gbl___hw_cfg.html">XAieGbl_HwCfg</a> *CfgPtr)</td></tr>
<tr class="memdesc:ac2dbe8c9e25ce298bffbc257a95ec530"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the routine to initialize the HW configuration.  <a href="#ac2dbe8c9e25ce298bffbc257a95ec530">More...</a><br/></td></tr>
<tr class="separator:ac2dbe8c9e25ce298bffbc257a95ec530"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad6422e72b033ca8d8456af7432d1fd11"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAieGbl_CfgInitialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl___tile.html">XAieGbl_Tile</a> *&#160;</td>
          <td class="paramname"><em>TileInstPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl___config.html">XAieGbl_Config</a> *&#160;</td>
          <td class="paramname"><em>ConfigPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the global initialization function for all the tiles of the AIE array and also for the Shim tiles. </p>
<p>The initialization involves programming the Tile instance data structure with the required parameters of the tile, like base addresses for Core module/Memory module/NoC module/Pl module, Stream switch configuration, Lock configuration etc.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>- Global AIE instance structure. </td></tr>
    <tr><td class="paramname">ConfigPtr</td><td>- Global AIE configuration pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_aie_gbl___config.html#a900a4a5a7781f9086f85929a187a5c05">XAieGbl_Config::ArrOffset</a>, <a class="el" href="struct_x_aie_gbl___tile.html#ac2d3e05eb2c91c4acd247a30294657ec">XAieGbl_Tile::ColId</a>, <a class="el" href="struct_x_aie_gbl.html#a9c2332098e39ee4a7906b6609d052a50">XAieGbl::Config</a>, <a class="el" href="struct_x_aie_gbl___tile.html#acb64f719ffdbd3d60f35a9d500eea6b4">XAieGbl_Tile::CoreModAddr</a>, <a class="el" href="struct_x_aie_gbl___tile.html#aed708d317ad8460b6f5e18b4d04a6d4d">XAieGbl_Tile::IsReady</a>, <a class="el" href="struct_x_aie_gbl.html#a8024c5684dcff87e1da578f16b73d13a">XAieGbl::IsReady</a>, <a class="el" href="struct_x_aie_gbl___tile.html#ad0b9bac7f4ea1a85b44b92c90bc12eda">XAieGbl_Tile::LockAddr</a>, <a class="el" href="struct_x_aie_gbl___tile.html#ac6c4759dc3e7922500782847a4a47e4a">XAieGbl_Tile::MemModAddr</a>, <a class="el" href="struct_x_aie_gbl___tile.html#a35d6071fc5f7fd25c4a0c5705d6e1e6e">XAieGbl_Tile::NocModAddr</a>, <a class="el" href="struct_x_aie_gbl___config.html#a10cc43c99e192e686de1adfccfece1bb">XAieGbl_Config::NumCols</a>, <a class="el" href="struct_x_aie_gbl___config.html#a1877b993d1f0878175039cbf0c0825c7">XAieGbl_Config::NumRows</a>, <a class="el" href="struct_x_aie_gbl___tile.html#a76d5964e5852893f7a6312008f69a0df">XAieGbl_Tile::PlModAddr</a>, <a class="el" href="struct_x_aie_gbl___tile.html#ac03cd2da6ba757671e46f0bd24ff84b5">XAieGbl_Tile::RowId</a>, <a class="el" href="struct_x_aie_gbl___tile.html#a39ea4a300c6ee7e2a6b2b463f1eadb7c">XAieGbl_Tile::StrmSwAddr</a>, <a class="el" href="struct_x_aie_gbl___tile.html#a7c04a73941e64980a264a9d529fbb571">XAieGbl_Tile::TileAddr</a>, <a class="el" href="struct_x_aie_gbl.html#a98df3208427d63ba640d1ff5093adf54">XAieGbl::Tiles</a>, <a class="el" href="struct_x_aie_gbl___tile.html#aadd948557d2723faa0cf47419e7d8a6e">XAieGbl_Tile::TileType</a>, <a class="el" href="xaielib_8c.html#afdc31b0bb30d8c0015f40e5ac047b8cd">XAieLib_InitDev()</a>, <a class="el" href="xaielib_8c.html#aef3dab7b9235d8b5fd82fb51d0955286">XAieLib_InitTile()</a>, and <a class="el" href="xaietile__event_8c.html#af98f8dee51d1017df85522613522492d">XAieTile_EventsSetupDefaultHandlers()</a>.</p>

<p>Referenced by <a class="el" href="xaie-events_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="ac2dbe8c9e25ce298bffbc257a95ec530"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAieGbl_HwInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl___hw_cfg.html">XAieGbl_HwCfg</a> *&#160;</td>
          <td class="paramname"><em>CfgPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the routine to initialize the HW configuration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CfgPtr,:</td><td>Pointer to the HW configuration data structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_aie_gbl___hw_cfg.html#a21536b409a299ac3e4eee6013d06f303">XAieGbl_HwCfg::ArrayOff</a>, <a class="el" href="struct_x_aie_gbl___config.html#a900a4a5a7781f9086f85929a187a5c05">XAieGbl_Config::ArrOffset</a>, <a class="el" href="struct_x_aie_gbl___config.html#a10cc43c99e192e686de1adfccfece1bb">XAieGbl_Config::NumCols</a>, <a class="el" href="struct_x_aie_gbl___hw_cfg.html#ad6b7fee60b721424a8840113f0f026c9">XAieGbl_HwCfg::NumCols</a>, <a class="el" href="struct_x_aie_gbl___config.html#a1877b993d1f0878175039cbf0c0825c7">XAieGbl_Config::NumRows</a>, and <a class="el" href="struct_x_aie_gbl___hw_cfg.html#a386ee289463f3cfe2021b59d34158a41">XAieGbl_HwCfg::NumRows</a>.</p>

<p>Referenced by <a class="el" href="xaie-events_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ae21f879b80da9aca8212dbb9d33696cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_x_aie_gbl___config.html">XAieGbl_Config</a> XAieGbl_ConfigTable[]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>XAIE_BASE_ARRAY_ADDR_OFFSET macro defines the AI Engine's base address offset value. </p>
<p>This value is left-shift by 30-bits to obtain the complete physical address of AIE.</p>
<p>FIXME: The Makefile used to compile AIE application for ARM Cortex-R5, by default, adds 'ARMR5' compiler flag. Since the XSA file generated using the latest tool hides the remapped address of AIE for R5, this compiler flag can be leveraged to hardcode the value of XAIE_BASE_ARRAY_ADDR_OFFSET. When AIE adress is available in RPU address map, the aiengine.tcl file for BareMetal and XAieIO_Init API for Linux flow must be modified to remove the hardcoded value. For BareMetal applications, the XAIE_BASE_ARRAY_ADDR_OFFSET value needs to be parsed by the TCL script from the XSA file. On the other hand, for the Linux application, this value needs to be parsed from the device tree.</p>
<p>XAIE_BASE_ARRAY_ADDR_OFFSET macro defines the AI Engine's base address offset value. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
